<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>{:isset($info['id'])?'编辑':'新增'}店铺</h2>
    </div>
    <div class="tab-wrap">
        <ul class="tab-nav nav">
            <li data-tab="tab1" class="current"><a href="javascript:void(0);">编 辑</a></li>

        </ul>
        <div class="tab-content">
            <form action="{:U('add')}" method="post" class="form-horizontal">
                <!-- 基础 -->
                <div id="tab1" class="tab-pane in tab1">

                    <div class="form-item">
                        <label class="item-label">分屏名称</label>
                        <div class="controls">
                            <input type="text" name="title" class="text input-large" value="{$info.title|default=''}">
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">定向曝光数量</label>
                        <div class="controls">
                            <input type="number" name="up_num" class="text input-large" value="{$info.up_num|default=''}">
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">定向引流数量</label>
                        <div class="controls">
                            <input type="number" name="in_num" class="text input-large" value="{$info.in_num|default=''}">
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">设备编号</label>
                        <div class="controls">
                            <input type="text" name="equipment" class="text input-large" value="{$info.equipment|default=''}">
                        </div>
                    </div>
                </div>
                <!-- 高级 -->
                <div class="form-item">
                    <input type="hidden" name="id" value="{$info.id|default=''}">
                    <button type="submit" id="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>
                    <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
                </div>
            </form>
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        <present name="info.id">
            Think.setValue("allow_publish", {$info.allow_publish|default=1});
        Think.setValue("check", {$info.check|default=0});
        Think.setValue("model[]", {$info.model|json_encode} || [1]);
        Think.setValue("type[]", {$info.type|json_encode} || [2]);
        Think.setValue("display", {$info.display|default=1});
        Think.setValue("reply", {$info.reply|default=0});
        Think.setValue("reply_model[]", {$info.reply_model|json_encode} || [1]);
        </present>
        $(function(){
            showTab();
            $("input[name=reply]").change(function(){
                var $reply = $(".form-item.reply");
                parseInt(this.value) ? $reply.show() : $reply.hide();
            }).filter(":checked").change();
        });
        //导航高亮
        highlight_subnav('{:U('Screen/index')}');
    </script>
</block>
